package com.aspose.cells;

class zfm {
   private static final com.aspose.cells.b.c.a.za a = new com.aspose.cells.b.c.a.za(new String[]{"IF", "VLOOKUP", "ISBLANK", "ISERROR", "ISERR", "RANK", "SUMIF", "COUNTIF", "AVERAGEIF", "_xlfn.SUMIF", "_xlfn.COUNTIF", "_xlfn.AVERAGEIF", "COUNTIFS", "_xlfn.COUNTIFS", "SUMIFS", "_xlfn.SUMIFS", "AVERAGEIFS", "_xlfn.AVERAGEIFS", "LEN", "FIND", "MID", "RIGHT", "SEARCH", "LEFT", "SUMPRODUCT"});

   static boolean a(zabd var0, boolean var1) {
      boolean var2 = false;
      if (var0 != null && var0.c() != null) {
         if (!var1) {
            switch(var0.f()[0]) {
            case 24:
               if (var0.f()[1] == 7 || var0.f()[1] == 25) {
                  var1 = true;
               }
               break;
            case 69:
            case 77:
            case 89:
            case 91:
               var1 = true;
               break;
            default:
               switch(var0.c().i()) {
               case 3:
               case 4:
               case 5:
                  switch(a.a(var0.c().b())) {
                  case 0:
                     if (var0.c().d().get(0) != var0) {
                        return a(var0.c(), true);
                     }
                     break;
                  case 1:
                     if (var0.c().d().get(2) == var0) {
                        return true;
                     }
                  }
               }
            }
         }

         if (var1) {
            switch(var0.c().i()) {
            case 2:
            case 6:
               var2 = true;
               break;
            case 3:
            case 4:
            case 5:
               int var3;
               switch(a.a(var0.c().b())) {
               case 0:
                  if (var0.c().d().get(0) == var0) {
                     if (var0.c().f()[0] == 34) {
                        var2 = true;
                     }
                  } else {
                     var2 = a(var0.c(), var1);
                  }
                  break;
               case 1:
               case 5:
                  if (var0.c().d().get(0) == var0 || var0.c().d().size() >= 4 && var0.c().d().get(3) == var0) {
                     var2 = true;
                  }
                  break;
               case 2:
               case 3:
               case 4:
                  var2 = true;
                  break;
               case 6:
               case 7:
               case 8:
               case 9:
               case 10:
               case 11:
                  if (var0.c().d().get(1) == var0) {
                     return true;
                  }
                  break;
               case 12:
               case 13:
                  for(var3 = 0; var3 < var0.c().d().size(); ++var3) {
                     if (var0.c().d().get(var3) == var0 && var3 % 2 == 1) {
                        return true;
                     }
                  }

                  return var2;
               case 14:
               case 15:
               case 16:
               case 17:
                  for(var3 = 2; var3 < var0.c().d().size(); ++var3) {
                     if (var0.c().d().get(var3) == var0 && var3 % 2 == 0) {
                        return true;
                     }
                  }

                  return var2;
               case 18:
               case 19:
               case 20:
               case 21:
               case 22:
               case 23:
                  return true;
               }
            }
         }
      } else {
         var2 = true;
      }

      return var2;
   }

   static int[] a(Cell var0, int var1, int var2, int var3, int var4) {
      int[] var5 = new int[2];
      if (var0 != null) {
         var5[0] = var0.getRow();
         var5[1] = var0.getColumn();
      }

      if (var5[0] >= var1 && var5[0] <= var3 && var5[1] >= var2 && var5[1] <= var4) {
         return var5;
      } else {
         if (var1 == var3) {
            if (var2 == var4) {
               var5[0] = var1;
               var5[1] = var2;
               return var5;
            }

            if (var5[1] >= var2 && var5[1] <= var4) {
               var5[0] = var1;
               return var5;
            }
         } else if (var2 == var4 && var5[0] >= var1 && var5[0] <= var3) {
            var5[1] = var2;
            return var5;
         }

         return null;
      }
   }

   static boolean a(zabd var0) {
      if (var0.c() != null && "INDEX".equals(var0.c().b()) && var0.c().d().get(0) == var0) {
         return true;
      } else {
         while(var0.c() != null) {
            var0 = var0.c();
            if (var0.i() == 3) {
               switch(a.a(var0.b())) {
               case 24:
                  return true;
               }
            }
         }

         return false;
      }
   }
}
